const items = [
  {
    title: 'basic',
    elements: [
      {
        // 默认
        shape: 'model-rect',
        label: '归一化',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
      {
        // 默认
        shape: 'model-rect',
        label: 'A',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
      {
        // 默认
        shape: 'model-rect',
        label: 'B',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
      {
        // 默认
        shape: 'model-rect',
        label: 'C',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
      {
        // 默认
        shape: 'model-rect',
        label: 'D',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
      {
        // 默认
        shape: 'model-rect',
        label: 'E',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
    ],
  },
  {
    title: 'other',
    elements: [
      {
        // 默认
        shape: 'model-rect',
        label: '归一化',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
      {
        // 默认
        shape: 'model-rect',
        label: 'A',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
      {
        // 默认
        shape: 'model-rect',
        label: 'B',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
      {
        // 默认
        shape: 'model-rect',
        label: 'C',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
      {
        // 默认
        shape: 'model-rect',
        label: 'D',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
      {
        // 默认
        shape: 'model-rect',
        label: 'E',
        ports: {
          in: ['port1'],
          out: ['port2'],
        },
      },
    ],
  },
]

// items.forEach((item) => {
//   const title = item.title
//   console.log(title)
//   const elements = item.elements.map((element) => {
//     let portItems = []
//     Object.keys(element.ports).forEach((key) => {
//       element.ports[key].forEach((aPortOfKey) => {
//         if (typeof aPortOfKey === 'string') {
//           let portItem = {
//             id: aPortOfKey,
//             group: key,
//             attrs: {
//               text: {
//                 text: aPortOfKey,
//               },
//             },
//           }
//           portItems.push(portItem)
//         }
//       })
//     })

//     return {
//       shape: element.shape,
//       label: element.label,
//       ports: {
//         items: portItems,
//       },
//     }
//   })

// })

export { items }
